<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->increments('oid')->unsigned()->comment('订单id');
            $table->char('orsn',15)->comment('订单号');
            $table->unsignedInteger('uid')->comment('下单者的用户id');
            $table->char('openid',32)->comment('用户openid');
            $table->char('xm',5)->comment('收货人姓名');
            $table->string('address',60)->comment('收货人地址');
            $table->decimal('money',9,2)->comment('订单金额');
            $table->tinyInteger('ispay')->default(0)->comment('支付状态');
            $table->integer('ortime')->comment('下单时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('orders');
    }
}
